/**
 * Created with JetBrains WebStorm.
 * User: shaoshuai
 * Date: 12-8-7
 * Time: 上午2:08
 */
var fs = require('fs');
var HttpdConfParser = function () {
};
HttpdConfParser.prototype.parse = function (file) {
    var content = fs.readFileSync(file, 'utf-8');
    var array = content.split('\n');
    var newArray = [];
    var tmp;
    for (var i = 0; i < array.length; i++) {
        tmp = array[i].trim();
        if (tmp !== '' && tmp.charAt(0) !== '#') {
            newArray.push(array[i]);
        }
    }
    fs.writeFileSync('httpd.parse.conf', newArray.join('\n'));
};
new HttpdConfParser().parse('httpd.conf');
